<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<title>Document</title>
	</head>
	<body>
		
	</body>
	<script>
		//数组合并
		let arr = [1,2,3]
		let arr2 = [4,5,6]
		let newArr = [...arr,...arr2]
		console.log(newArr);
		
		//Array.of
		//Array.from
		
		//es5
		let person = {
			//键值对
			name:"shane",
			age:12,
			run:function(){
				console.log("run");
			}
		}
		console.log(person);
		
		//es6
		let person2 = {
			//键值对
			name:"shane",
			age:12,
			run(){
				console.log("run");
			}
		}
		console.log(person2);
		
		let name = "Tom"
		//对象属性的表达式，通过表达式创建属性
		obj = {
			[newName+"friend"]:"Jerry",
			[newName+'age']:12
		}
		
		console.log(obj);
		
		//对象的扩展运算符...
		obj2 = {
			name:'tom'
		}
		
		obj3 = {
			...obj2
		}
		
		console.log(obj3);
		
		obj4 = {
			age:100
		}
		
		console.log({...obj,...obj2,...obj3,...obj4});
		
		//Object.assign(Target,Source)
		Object.assign(obj,obj4)
		console.log(obj);
	</script>
</html>
